package com.leonardo.persistenceme.metadatahandlers;

import java.util.Vector;

public class PersistenceMetadataContainer {
	
	public static final String PERSISTENT = "persistent";
	public static final String TRANSIENT = "transient";
	
	private Vector fieldsNames = new Vector();
	private String id;
	private String type;
	
	public PersistenceMetadataContainer(String id) {
		this.id = id;
	}
	
	public String getId() {
		return id;
	}
	
	public Vector getFieldsNames() {
		return fieldsNames;
	}
	
	public void addField(String field) {
		fieldsNames.addElement(field);
	}
	
	public void setType(String type) {
		if(!PERSISTENT.equals(type) && !TRANSIENT.equals(type))
			throw new IllegalArgumentException("Type " + type + " does not exists");
		this.type = type;
	}
	
	public String getType() {
		return type;
	}
	
}
